package com.bjsxt.chapter12_chainOfResponsibility;

/**
 * @ClassName Client
 * @Description 客户端
 * @Author 黑马程序员
 * @Date 10:52 2024/6/23
 * @Version 1.0
 **/
public class Client {
    public static void main(String[] args) {
        // 真实项目中可单独再定义一个类来表示各个节点的值和关系
        Leader a = new Director("张三");
        Leader b = new Manager("李四");
        Leader c = new ViceGeneralManager("王五");
        Leader d = new GeneralManager("赵六");

        // 设定责任链上的后继对象
        a.setNextLeader(b);
        b.setNextLeader(c);
        c.setNextLeader(d);

        LeaveRequest request = new LeaveRequest("TOM", 2, "回英国老家探亲");
        // 开始请假操作
        a.handler(request);
    }
}
